package controllers

import (
	"github.com/gin-gonic/gin"
	"github.com/shenyisyn/goft-gin/goft"
	"sinery.net.goft/src/models"
	"sinery.net.goft/src/services"
	"time"
)

type UserController struct {
	Ctrl        *CommonController     `inject:"-"`
	UserService *services.UserService `inject:"-"`
}

func (i *UserController) Build(goft *goft.Goft) {

}
func (i *UserController) Index(ctx *gin.Context) goft.Json {
	insert := make([]models.NoticeContextModel, 0)
	contex := models.NoticeContextModel{}
	contex.NoticeContext = "sin"
	contex.CTime = int(time.Now().Unix())
	insert = append(insert, contex)
	return i.UserService.BatchInsert(insert)
}
func (i *UserController) Name() string {
	return "UserController"
}

func NewUserController() *UserController {
	return &UserController{}
}
